package 草稿包;

public class myList {
    ListNode head;

    void add(int val){
        ListNode node=new ListNode(1);
        if(head==null){
            head=node;
            return;
        }
        ListNode next=head.next;
        if(next!=null)next.prev=node;
        node.next=next;

        head.next=node;
        node.prev=head;
    }
}
